﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using BLL;
using Model;
using DevExpress.Data.Filtering;
using POS.Framework;

namespace POS.ModForm
{
    public partial class frmStoreChange : DevExpress.XtraEditors.XtraForm
    {
        public frmStoreChange()
        {
            InitializeComponent();
        }

        private void frmStoreChange_Load(object sender, EventArgs e)
        {
            this.popFormButtonUC.OK.Click += new EventHandler(btnOK_Click);
        }
        void btnOK_Click(object sender, EventArgs e)
        {
            string storeCode = this._StoreCode.Text.ToUpper();
            B_Store store = DatabaseSchema.Session.FindObject<B_Store>(CriteriaOperator.Parse("StoreCode=?", storeCode));
            if (store == null)
            {
                MsgBox.ShowWarning("输入的店柜编码不存在系统中！");
                return;
            }
            MemberInfo.StoreCode = storeCode;
            MemberInfo.Store = store;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}